package com.gqz.equip.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;


/**
 * 出入库订单
 *
 * @author gqz20
 * @date 2023/02/18
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("T_EN_WZ_CRK_ORDER")
public class TEnWzCrkOrderEntity implements Serializable {

    /**
     * 单据编码
     */
    @TableId
    private String id;

    /**
     * 单据日期
     */
    @TableField(value = "DJRQ")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(name = "djrq", format = "yyyy-MM-dd HH:mm:ss")
    private Date djrq;

    /**
     * 仓库名称
     */
    @TableField(value = "CKMC")
    private String ckmc;

    /**
     * 仓库编码
     */
    @TableField(value = "CKBM")
    private String ckbm;

    /**
     * 所属单位编码
     */
    @TableField(value = "SSDWBM")
    private String ssdwbm;

    /**
     * 所属单位名称
     */
    @TableField(value = "SSDWMC")
    private String ssdwmc;

    /**
     * 创建人
     */
    @TableField(value = "CJR")
    private String cjr;

    /**
     * 创建时间
     */
    @TableField(value = "CJ_TIME")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(name = "cjTime", format = "yyyy-MM-dd HH:mm:ss")
    private Date cjTime;

    /**
     * 类型 0 入库 1出库
     */
    @TableField(value = "TYPE")
    private String type;

    /**
     * 是否删除 0否1是
     */
    @TableField(value = "SFSC")
    private String sfsc;

    /**
     * 审核意见
     */
    @TableField(value = "SHYJ")
    private String shyj;

    /**
     * 审核时间
     */
    @TableField(value = "SH_TIME")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(name = "shTime", format = "yyyy-MM-dd HH:mm:ss")
    private Date shTime;

    /**
     * 出入库数量
     */
    @TableField(value = "SL")
    private String sl;

    /**
     * 修改时间
     */
    @TableField(value = "UPDATE_TIME")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(name = "updateTime", format = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    /**
     * 修改人
     */
    @TableField(value = "UPDATE_PERSON")
    private String updatePerson;

    /**
     * 单据审核状态编码
     */
    @TableField(value = "DJSHZT")
    private String djshzt;

    /**
     * 单据审核状态名称
     */
    @TableField(value = "DJSHZTMC")
    private String djshztmc;

    /**
     * 审核人
     */
    @TableField(value = "SH_PERSON")
    private String shPerson;

    /**
     * 审核结论编码
     */
    @TableField(value = "SHJLBM")
    private String shjlbm;

    /**
     * 审核结论名称
     */
    @TableField(value = "SHJLMC")
    private String shjlmc;

    /**
     * 创建人id
     */
    @TableField(value = "CJRBM")
    private String cjrbm;

    /**
     * 设备编码
     */
    @TableField(exist = false)
    private String sbbm;

    /**
     * 设备名称
     */
    @TableField(exist = false)
    private String sbmc;

    /**
     * 运行状态编码
     */
    @TableField(exist = false)
    private String yxzt;

    /**
     * start这个是必须要的动态条件集合start   start
     */
    private static Map<String, SFunction<TEnWzCrkOrderEntity, ?>> map;

    static {
        map = new HashMap<>();
        map.put("id", TEnWzCrkOrderEntity::getId);
        map.put("djrq", TEnWzCrkOrderEntity::getDjrq);
        map.put("ckmc", TEnWzCrkOrderEntity::getCkmc);
        map.put("ckbm", TEnWzCrkOrderEntity::getCkbm);
        map.put("ssdwbm", TEnWzCrkOrderEntity::getSsdwbm);
        map.put("ssdwmc", TEnWzCrkOrderEntity::getSsdwmc);
        map.put("cjr", TEnWzCrkOrderEntity::getCjr);
        map.put("cjTime", TEnWzCrkOrderEntity::getCjTime);
        map.put("type", TEnWzCrkOrderEntity::getType);
        map.put("sfsc", TEnWzCrkOrderEntity::getSfsc);
        map.put("shyj", TEnWzCrkOrderEntity::getShyj);
        map.put("shTime", TEnWzCrkOrderEntity::getShTime);
        map.put("sl", TEnWzCrkOrderEntity::getSl);
        map.put("updateTime", TEnWzCrkOrderEntity::getUpdateTime);
        map.put("updatePerson", TEnWzCrkOrderEntity::getUpdatePerson);
        map.put("djshzt", TEnWzCrkOrderEntity::getDjshzt);
        map.put("djshztmc", TEnWzCrkOrderEntity::getDjshztmc);
        map.put("shPerson", TEnWzCrkOrderEntity::getShPerson);
        map.put("shjlbm", TEnWzCrkOrderEntity::getShjlbm);
        map.put("shjlmc", TEnWzCrkOrderEntity::getShjlmc);
        map.put("sbbm", TEnWzCrkOrderEntity::getSbbm);
        map.put("sbmc", TEnWzCrkOrderEntity::getSbmc);
        map.put("yxzt", TEnWzCrkOrderEntity::getYxzt);
        map.put("cjrbm", TEnWzCrkOrderEntity::getCjrbm);
    }

    public static SFunction<TEnWzCrkOrderEntity, ?> genColumnSFunction(String column) {
        return map.get(column);
    }
    /** end这个是必须要的动态条件集合end   end */


}
